import 'package:kkhousekeep/generated/json/base/json_convert_content.dart';
import 'package:kkhousekeep/models/home_bill_details_entity.dart';

HomeBillDetailsEntity $HomeBillDetailsEntityFromJson(Map<String, dynamic> json) {
	final HomeBillDetailsEntity homeBillDetailsEntity = HomeBillDetailsEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		homeBillDetailsEntity.code = code;
	}
	final HomeBillDetailsObj? obj = jsonConvert.convert<HomeBillDetailsObj>(json['obj']);
	if (obj != null) {
		homeBillDetailsEntity.obj = obj;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		homeBillDetailsEntity.msg = msg;
	}
	return homeBillDetailsEntity;
}

Map<String, dynamic> $HomeBillDetailsEntityToJson(HomeBillDetailsEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['obj'] = entity.obj.toJson();
	data['msg'] = entity.msg;
	return data;
}

HomeBillDetailsObj $HomeBillDetailsObjFromJson(Map<String, dynamic> json) {
	final HomeBillDetailsObj homeBillDetailsObj = HomeBillDetailsObj();
	final String? address = jsonConvert.convert<String>(json['address']);
	if (address != null) {
		homeBillDetailsObj.address = address;
	}
	final List<HomeBillDetailsObjItems>? items = jsonConvert.convertListNotNull<HomeBillDetailsObjItems>(json['items']);
	if (items != null) {
		homeBillDetailsObj.items = items;
	}
	final double? totalMoney = jsonConvert.convert<double>(json['totalMoney']);
	if (totalMoney != null) {
		homeBillDetailsObj.totalMoney = totalMoney;
	}
	return homeBillDetailsObj;
}

Map<String, dynamic> $HomeBillDetailsObjToJson(HomeBillDetailsObj entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['address'] = entity.address;
	data['items'] =  entity.items.map((v) => v.toJson()).toList();
	data['totalMoney'] = entity.totalMoney;
	return data;
}

HomeBillDetailsObjItems $HomeBillDetailsObjItemsFromJson(Map<String, dynamic> json) {
	final HomeBillDetailsObjItems homeBillDetailsObjItems = HomeBillDetailsObjItems();
	final String? itemName = jsonConvert.convert<String>(json['itemName']);
	if (itemName != null) {
		homeBillDetailsObjItems.itemName = itemName;
	}
	final int? feeItemProperty = jsonConvert.convert<int>(json['feeItemProperty']);
	if (feeItemProperty != null) {
		homeBillDetailsObjItems.feeItemProperty = feeItemProperty;
	}
	final String? detail = jsonConvert.convert<String>(json['detail']);
	if (detail != null) {
		homeBillDetailsObjItems.detail = detail;
	}
	final double? damages = jsonConvert.convert<double>(json['damages']);
	if (damages != null) {
		homeBillDetailsObjItems.damages = damages;
	}
	final int? state = jsonConvert.convert<int>(json['state']);
	if (state != null) {
		homeBillDetailsObjItems.state = state;
	}
	final String? startDate = jsonConvert.convert<String>(json['startDate']);
	if (startDate != null) {
		homeBillDetailsObjItems.startDate = startDate;
	}
	final String? endDate = jsonConvert.convert<String>(json['endDate']);
	if (endDate != null) {
		homeBillDetailsObjItems.endDate = endDate;
	}
	return homeBillDetailsObjItems;
}

Map<String, dynamic> $HomeBillDetailsObjItemsToJson(HomeBillDetailsObjItems entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['itemName'] = entity.itemName;
	data['feeItemProperty'] = entity.feeItemProperty;
	data['detail'] = entity.detail;
	data['damages'] = entity.damages;
	data['state'] = entity.state;
	data['startDate'] = entity.startDate;
	data['endDate'] = entity.endDate;
	return data;
}